\usepackage{booktabs}

\usepackage{float}
\usepackage{index}
% index functions separately
\newindex{code}{adx}{and}{R code index}
\newcommand{\indexf}[1]{\index[code]{#1@\texttt{#1()}}}
\newcommand{\indexc}[1]{\index[code]{#1@\texttt{#1}}}

\DeclareGraphicsExtensions{.pdf,.png}

% Place links in parens
\renewcommand{\href}[2]{#2 (\url{#1})}
% Use auto ref for internal links
\let\oldhyperlink=\hyperlink
\renewcommand{\hyperlink}[2]{\autoref{#1}}
\def\chapterautorefname{Chapter}
\def\sectionautorefname{Section}
\def\subsectionautorefname{Section}
\def\subsubsectionautorefname{Section}

\setlength{\emergencystretch}{3em}  % prevent overfull lines
\vbadness=10000 % suppress underfull \vbox
\hbadness=10000 % suppress underfull \vbox
\hfuzz=10pt

\makeindex
